<style>
    .information p {
        text-overflow: -o-ellipsis-lastline;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
</style>
<div id="productList">
<?php if(!empty($output['bargain_list']) && is_array($output['bargain_list'])){ ?>
    <?php foreach($output['bargain_list'] as $k=>$v ){ ?>

    <div class="commodity">

        <div class="img">
            <?php if($v['is_hot']==1){ ?>
               <!-- <img class="icon" src="resource/images/img-20-1.png">-->
            <?php } ?>
            <a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>"><img src="<?php echo getbargain_img($v['bg_thumb']) ?>" /></a>
        </div>

        <div class="information">
            <p onclick="javascript:window.location.href='index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>'"><?php echo  $v['bg_title']; ?></p>
            <?php if($v['is_hot']==1) {?>
            <span style="font-size: .8rem;text-align: center;line-height: 1.3rem;padding:0 .5%; ">仅限<?php echo $v['bg_store']; ?>份</span>
            <?php } ?>
            <p class="participants" style="font-size: .8rem;"><?php echo $v['bg_rs']; ?>人参与</p>

            <div class="price">
                <p class="originalPrice" style="font-size: .8rem; margin-top: -5px;">原价 <span>￥<?php echo $v['bg_price']; ?></span>  </p>
                <p class="floorPrice" style="font-size: 1.1rem;">最低价  <span>￥<?php echo $v['bg_floorprice']; ?></span>   </p>
            </div>
            <a href="index.php?act=bargain&op=bargain_info&bargain_id=<?php echo $v['bargain_id']; ?>" >我要参与</a>
        </div>
    </div>
        <?php } ?>

<?php }?>
</div>
<div class="footer-group"><a href="index.php?act=bargain_order"><button style="box-shadow: 0 0 0.4rem 0.1rem #24ca71;font-size: .9rem;line-height:12px;">我参<br>与的</button></a></div>
<div style="height: 50px;"></div>

<script>
    var allNum = <?php echo $output['TotalNum']; ?>,
        allPage = <?php echo $output['TotalPage']; ?>,
        curPage = 1;

    var is_scroll = false;
    //ajax加载数据
    function loadpage() {
        if(!is_scroll){
            return;
        }
        if (curPage < allPage) {
            curPage += 1;
        } else {
            return;
        }
        $.get(location.href, {isajax:1,curpage:curPage},function(data){
            if(data){
                $("#productList").append(data);
            }
        });
    }

    $(window).scroll(function () {


        is_scroll = true;
        //已经滚动到上面的页面高度
        var scrollTop = $(this).scrollTop();
        //页面高度
        var scrollHeight = $(document).height();
        //浏览器窗口高度
        var windowHeight = $(this).height();
        //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
        if (scrollTop + windowHeight == scrollHeight) {
            loadpage();
        }
    });

</script>